package ClassType;

import java.lang.reflect.Constructor;

public class Demo1 extends Demo{
	public static void main(String[] args) {
		System.out.println("getName:"+Demo1.class.getName());
		System.out.println("getSimpleName:"+Demo1.class.getSimpleName());
		System.out.println("getCanonicalName:"+Demo1.class.getCanonicalName());//返回包含这个类的包和类明？
		
	/*	Class<?>[] clazz=Demo1.class.getClasses();
		for (Class<?> class1 : clazz) {
			System.out.println(class1.getSimpleName());
		}*/
		Constructor<?>[]  cons=Demo1.class.getConstructors();//返回这个class的所有构造函数
		for (Constructor<?> constructor : cons) {
			System.out.println(constructor);
		}
		Constructor<?>[]  cons2=Demo1.class.getDeclaredConstructors();
		for (Constructor<?> constructor : cons2) {
			System.out.println(constructor);
		}
		System.out.println();
	}
}
class Demo{
	private String good;

	public String getGood() {
		return good;
	}

	public void setGood(String good) {
		this.good = good;
	}
}
